< previous page page_209 next page >

Page 209
CDbl( )
CDbl() converts any numeric or string expression into a double value. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdCDbl_Click ()
   Dim dblValue As Double

   dblValue = CDbl("12.99334")

   Me.Cls
   Me.Print dblValue
End Sub
CInt( )
CInt() converts any numeric or string expression into an integer value. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdCInt_Click ()
   Dim intCount As Integer

   intCount = CInt(1555.9)

   Me.Cls
   Me.Print intCount
End Sub
Heres the output:
9f31265bb40b592b1929e18a47ab28e5.gif
1556
9f31265bb40b592b1929e18a47ab28e5.gif
NOTE
The
CInt() function does round any decimal portion.
CLng( )
CLng() converts any numeric or string expression into a long value. Heres an example:
9f31265bb40b592b1929e18a47ab28e5.gif
Private Sub cmdCLng_Click ()
   Dim lngRet As Long

 
< previous page page_209 next page >

If you like this book, buy it!